package cn.kgc.service.impl;

import cn.kgc.entity.Item;
import cn.kgc.mapper.ItemMapper;
import cn.kgc.pojo.ItemQuery;
import cn.kgc.service.ItemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ItemServiceImpl implements ItemService {
    @Resource
    private ItemMapper itemMapper;

    @Override
    public List<Item> getAllItem() {
        return itemMapper.getAllItem();
    }

    @Override
    public Item getItemById(Integer id) {
        return itemMapper.getItemById(id);
    }

    @Override
    public void addItem(Item item) {
        itemMapper.addItem(item);
    }

    @Override
    public void updateItem(Item item) {
        itemMapper.updateItem(item);
    }

    @Override
    public void deleteItemById(Integer id) {
        itemMapper.deleteItemById(id);
    }

    @Override
    public List<Item> getItemList(ItemQuery itemQuery) {
        return itemMapper.getItemList(itemQuery);
    }

    @Override
    public Integer countItem() {
        return itemMapper.countItem();
    }

    @Override
    public Integer countPid(Long pid) {
        return itemMapper.countPid(pid);
    }
}
